<?php
/**
* The template for displaying Search Results pages.
*/

get_header();

	// SIDEBAR
	$content_class = ' class="position_left"';
	$sidebar_class = ' class="position_right"';

	$website_selected_position = get_option('sidebar_position');
	
	if ( $website_selected_position == 'left' )
	{
		$content_class = ' class="position_right"';
		$sidebar_class = ' class="position_left"';
	}

	if ( have_posts() ) the_post();	

?>

	<section id="content_wrapper" class="clearfix">
        <div id="content_with_sidebar" <?php echo $content_class; ?>>
            <h2 class="page_title">
                <?php
				
				printf( __( 'Search Results for: %s', 'reFresh' ), get_search_query() );
				
				?>
            </h2>
            <div class="page_content">
                <?php
				
				if ( have_posts() )
					get_template_part( 'loop', 'search' );
				
				else
				{
					echo '<div class="content_intro">';
						_e( 'Sorry, but nothing matched your search criteria. Please try again with some different keywords.', 'reFresh' );
					echo '</div>';
					get_search_form();
				}
				
				?>
            </div><!-- .page_content -->
            
        </div> <!-- #content_with_sidebar -->
        
        <?php
        echo '<div id="sidebar"'.$sidebar_class.'>';
            echo '<div id="sidebar_content">';
                get_sidebar();
            echo '</div>';
        echo '</div>';
        ?>
        
    </section> <!-- #content_wrapper -->

<?php get_footer(); ?>